package jgl.vajra.kingkong.part.vehicle.viewModel;

import java.util.Map;

import jgl.vajra.kingkong.bean.OrderDetailsCompleteBean;
import jgl.vajra.kingkong.part.vehicle.contract.OrderDetailsCompleteContract;
import jgl.vajra.kingkong.part.vehicle.model.OrderDetailsCompleteModel;
import jgl.vajra.kingkong.widget.mvvm.factory.CreateModel;
import jgl.vajra.kingkong.widget.retrofithelper.rxsubscriber.ProgressObserver;

@CreateModel(OrderDetailsCompleteModel.class)
public class OrderDetailsCompleteViewModel extends OrderDetailsCompleteContract.ViewModel{
    @Override
    public void getOrderDetailsCompleteData(Map<String, Object> map) {
        mModel.getOrderDetailsCompleteData(map).subscribe(new ProgressObserver<OrderDetailsCompleteBean>(true,this) {
            @Override
            public void _onNext(OrderDetailsCompleteBean data) {
                mView.returnOrderDetailsCompleteData(data);
            }

            @Override
            public void _onError(String errorMessage, int errorCode) {
                super._onError(errorMessage, errorCode);
            }
        });
    }
}
